<template>
  <div v-if="model&&model.modelKey=='zhubo'" :key="model.modelKey" class="model_box zhubo_box">
    <div class="zhubo_box_inner" :style="`backgroundColor:${model.bgColor||''};${model.bgImage?('backgroundImage:url('+model.bgImage+');'):''}color:${model.txtColor||''}`">
      <div class="title-box flex fbt" >
        <div class="tit">
          合作主播
        </div>
        <!-- <div class="allzhubo flex alc" :style="`color:${model.allColor};`">
          <span>全部主播</span>
          <i  class="el-icon-arrow-right"></i>
        </div> -->
      </div>
      <div class="imgbtn-cont flex" v-if="model.list&&model.list.length">
        <div v-for="(item,i) in (model.list.length>4?model.list.slice(0,4):model.list)" :key="i" :style="{backgroundImage:'url('+item.img+')'}">
        </div>
      </div>
      <div v-else class="imgbtn-cont nonelist">
        <el-empty :image-size="80" description="暂无主播"></el-empty>
      </div>
    </div>
    <zhezhao @clickSet="clickItem('set')"></zhezhao>
  </div>
</template>

<script>
import zhezhao from '../zhezhao.vue';
export default {
  components:{zhezhao},
  props: {
    model: {
      type: Object,
      default: () => ({}),
    },
  },
  methods: {
    clickItem(type) {
      this.$emit('clickItem', {type: type, modelKey: this.model.modelKey})
    }
  }
};
</script>
<style lang="scss" scoped>
.zhubo_box {
  // padding: 0 !important;
  .zhubo_box_inner {
    padding: 10px ;
    padding-bottom: 0;
    background-color: transparent;
    border-radius: 8px;
  }
  .title-box {
    margin-bottom: 10px;
    .tit {
      font-size: 14px;
      font-weight: bold;
    }
  }

  .imgbtn-cont {
    flex-wrap: wrap;
    div {
      width: 158px;
      height: 142px;
      background-size: 100% 100%;
      margin-bottom: 8px;
      border-radius: 10px;
      &:nth-of-type(2n){
        margin-left: 8px;
      }
    }
    &.nonelist{
      width: 160px;
      height: 160px;
      margin: 0 auto;
    }
    
  }
}
</style>